import request from '@/utils/request'

// 业务类型 列表
export function platformList(data) {
  return request({
    url: '/newsDeclare/platform',
    method: 'get',
    params: data
  })
}

// 业务类型 添加
export function platformAdd(data) {
  return request({
    url: '/newsDeclare/platform',
    method: 'post',
    data: data
  })
}

// 业务类型 修改
export function platformEdit(data) {
  return request({
    url: '/newsDeclare/platform/' + data.id,
    method: 'put',
    data: data
  })
}

// 业务类型 删除
export function platformDel(id) {
  return request({
    url: '/newsDeclare/platform/' + id,
    method: 'delete'
  })
}

// 申报新闻、列表
export function getList(data) {
  return request({
    url: '/newsDeclare/institution',
    method: 'get',
    params: data
  })
}

// 申报新闻、列表
export function getReviewList(data) {
  return request({
    url: '/newsDeclare/review',
    method: 'get',
    params: data
  })
}

// 申报新闻、列表
export function getReviewDetail(id) {
  return request({
    url: '/newsDeclare/review/' + id,
    method: 'get'
  })
}

// 申报新闻、列表
export function getReviewCounts() {
  return request({
    url: '/newsDeclare/review/counts',
    method: 'get'
  })
}

export function getPostCounts() {
  return request({
    url: '/newsDeclare/institution/counts',
    method: 'get'
  })
}

// 申报新闻添加
export function newsDeclareAdd(data) {
  return request({
    url: '/newsDeclare/institution',
    method: 'post',
    data: data
  })
}

// 申报新闻修改
export function newsDeclareUpdate(data) {
  return request({
    url: '/newsDeclare/institution/' + data.id,
    method: 'put',
    data: data
  })
}

// 删除
export function delNewsDeclare(id) {
  return request({
    url: '/newsDeclare/institution/' + id,
    method: 'delete'
  })
}

// 推荐
export function reviewRecommend(id) {
  return request({
    url: '/newsDeclare/review/recommend/' + id,
    method: 'post'
  })
}

// 推荐
export function reviewBatchRecommend(data) {
  return request({
    url: '/newsDeclare/review/batch_recommend',
    method: 'post',
    data
  })
}

// 批量取消推荐
export function reviewBatchUnRecommend(data) {
  return request({
    url: '/newsDeclare/review/batch_unrecommend',
    method: 'post',
    data
  })
}

// 下载模板
export function reviewUnRecommend(id) {
  return request({
    url: '/newsDeclare/review/unrecommend/' + id,
    method: 'post'
  })
}

export function accEmployeeList(data) {
  return request({
    url: '/newsDeclare/acc/employeeList',
    method: 'post',
    data
  })
}
export function accCreateEmployee(data) {
  return request({
    url: '/newsDeclare/acc/createEmployee',
    method: 'post',
    data
  })
}
export function accUpdateEmployee(data) {
  return request({
    url: '/newsDeclare/acc/updateEmployee',
    method: 'post',
    data
  })
}
export function accDelEmployee(data) {
  return request({
    url: '/newsDeclare/acc/delEmployee',
    method: 'post',
    data
  })
}

export function accMyRoles(data) {
  return request({
    url: '/newsDeclare/acc/myRoles',
    method: 'post',
    data
  })
}
